package com.bank.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 存款类型实体类
 * 对应数据库表：deposit_type
 * 
 * @author 开发团队
 * @version 1.0.0
 * @since 2025-06-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("deposit_type")
public class DepositType implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 存款编号-主键
     */
    @TableId(value = "saving_id", type = IdType.AUTO)
    private Integer savingId;

    /**
     * 存款名称
     */
    @TableField("saving_name")
    @NotBlank(message = "存款名称不能为空")
    @Size(max = 50, message = "存款名称长度不能超过50个字符")
    private String savingName;

    /**
     * 存款描述
     */
    @TableField("description")
    @Size(max = 200, message = "存款描述长度不能超过200个字符")
    private String description;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 构造函数
     */
    public DepositType() {
    }

    /**
     * 带参构造函数
     * 
     * @param savingName 存款名称
     * @param description 存款描述
     */
    public DepositType(String savingName, String description) {
        this.savingName = savingName;
        this.description = description;
    }

    /**
     * 重写toString方法
     */
    @Override
    public String toString() {
        return "DepositType{" +
                "savingId=" + savingId +
                ", savingName='" + savingName + '\'' +
                ", description='" + description + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
